Python Feature Engineering Cookbook by Soledad Galli
Author:Soledad Galli
Language: eng
Format: epub
Tags: COM062000 - COMPUTERS / Data Modeling and Design, COM018000 - COMPUTERS / Data Processing, COM021030 - COMPUTERS / Databases / Data Mining
Publisher: Packt Publishing
Published: 2020-01-21T11:26:50+00:00
boston_dataset = load_boston()
data = pd.DataFrame(boston_dataset.data, columns=boston_dataset.feature_names)
data['MEDV'] = boston_dataset.target
The boundaries for the intervals should be learned using variables in the train set only, and then used to discretize the variables in train and test sets.
Let's divide the data into train and test sets and their targets:
X_train, X_test, y_train, y_test = train_test_split(
data.drop('MEDV', axis=1), data['MEDV'], test_size=0.3,
random_state=0)
We will divide the LSTAT continuous variable into 10 intervals. The width of the intervals is given by the value range divided by the number of intervals.
Let's calculate the range of the LSTAT variable, that is, the difference between its maximum and minimum values:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8293)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6677)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6654)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6524)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6314)
Driving Data Quality with Data Contracts by Andrew Jones(6267)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6029)
Learning SQL by Alan Beaulieu(5987)
Weapons of Math Destruction by Cathy O'Neil(5775)
Big Data Analysis with Python by Ivan Marin(5333)
Data Engineering with dbt by Roberto Zagni(4333)
Solidity Programming Essentials by Ritesh Modi(3978)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3835)
Pandas Cookbook by Theodore Petrou(3545)
Blockchain Basics by Daniel Drescher(3292)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2900)
Feature Store for Machine Learning by Jayanth Kumar M J(2808)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2791)
Mastering Python for Finance by Unknown(2743)
